package com.cxso.example.request.report;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class ReportEtcInvoiceRequest implements Serializable {

    @NotBlank
    @Schema(description = "主体id")
    private String bodyId;

    @Schema(description = "运单号")
    @NotBlank(message = "运单号不能为空")
    private String shippingNoteNumber;

    @Schema(description = "etc发票")
    @NotEmpty(message = "etc发票不能为空")
    private List<EtcInvoice> etcInvoices;


    @Getter
    @Setter
    public static class EtcInvoice {

        @Schema(description = "发票代码")
        @NotBlank(message = "发票代码不能为空")
        private String invoiceCode;

        @Schema(description = "发票号码")
        @NotBlank(message = "发票号码不能为空")
        private String invoiceNumber;

        @Schema(description = "发票含税金额")
        @NotNull(message = "发票含税金额不能为空")
        private BigDecimal amount;

        @Schema(description = "税率")
        @NotNull(message = "税率不能为空")
        private BigDecimal tax;

        @Schema(description = "开票时间")
        @NotNull(message = "开票时间不能为空")
        private Date invoiceTime;

        @Schema(description = "高速入站口")
        private String startSite;

        @Schema(description = "高速出站口")
        private String endSite;

        @Schema(description = "发票销售方名称")
        private String sellerName;

        @Schema(description = "销方税号", example = "123456789012345678")
        private String sellerTaxpayerCode;

        @Schema(description = "发票下载链接", example = "https://example.com/invoice.pdf")
        private String invoiceUrl;

        @Schema(description = "交易金额（单位：分）", example = "1000")
        private BigDecimal fee;


    }


}
